﻿using GameTools.Models;
using Loli.Library.Util;
using Loli.Library.WinForm;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace GameTools
{
    public class SplashScreen : SplashScreenApplicationContext
    {
        protected override void OnCreateSplashScreenForm()
        {
            this.SplashScreenForm = new SplashScreenForm(Properties.Resources.Welcome);//启动窗体 
        }

        protected override void OnCreateMainForm()
        {
           
            //删除临时文件
            foreach (var item in Directory.GetFiles(AppDomain.CurrentDomain.BaseDirectory, "*.delete", SearchOption.AllDirectories))
            {
                File.Delete(item);
            }
            DataCenter dataCenter = DataCenter.Load();
            this.PrimaryForm = new MainForm(dataCenter);//主窗体 
            //载入数据        
        }

        protected override void SetSeconds()
        {
            this.SecondsShow = 1;//启动窗体显示的时间(秒) 
        }
    }
}
